package ace.module.product.api.model.input;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.PositiveOrZero;
import jakarta.validation.constraints.Size;
import java.util.TreeMap;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 添加商品基础资料.
 * @author Caspar
 *
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class PmsProductSkuSaveInput {

  @NotEmpty
  @Size(max = 5)
  @Schema(title = "商品sku规格属性组合的唯一key ", description = "json格式：{'name':'value','name1':'value1'...}")
  private TreeMap<String, String> attributes;

  @Builder.Default
  @NotNull
  @Schema(title = "上架状态", description = "1-上架 2-下架")
  private Integer saleStatus = 2;

  @Builder.Default
  @Size(max = 255)
  @Schema(title = "商品sku编号", description = "自动填充")
  private String sn = "";

  @Builder.Default
  @NotNull
  @PositiveOrZero
  @Schema(title = "价格", description = "单价-分")
  private Long price = 0L;

  @Builder.Default
  @NotNull
  @PositiveOrZero
  @Schema(title = "市场价格", description = "单价-分")
  private Long marketPrice = 0L;

  @Builder.Default
  @NotNull
  @PositiveOrZero
  @Schema(title = "重量", description = "单位-毫克")
  private Long weight = 0L;

  @Builder.Default
  @NotNull
  @Schema(title = "排序", description = "")
  private Integer sort = 0;

  @Builder.Default
  @Size(max = 1000)
  @Schema(title = "主图")
  private String mainImgUrl = "";

  @Builder.Default
  @NotNull
  @PositiveOrZero
  @Schema(title = "库存", description = "")
  private Long stock = 0L;


}
